<template>
<!--  <grid-manager :option="gridOption" :callback="callback" ref="grid"></grid-manager>-->
<div>
  <el-row>
    <el-col :span="12"><el-button type="text" @click="open">点击打开 Message Box</el-button></el-col>
    <el-col :span="12"><el-button type="text" @click="openMsg">点击打开 Message Box</el-button> </el-col>
    <el-col :span="12"><el-button type="text" @click="openLink">打开外部链接</el-button> </el-col>
  </el-row>
  <el-row>
    <el-col :span="6">
      <router-link to='views/userList'>
        <button>点击跳转2</button>
      </router-link>
    </el-col>
    <el-col :span="6">
      <router-link :to="{path:'https://www.baidu.com/', query:{id:1,name:'vue'}}" target="_blank">百度
      </router-link>
    </el-col>
  </el-row>
  <el-col :span="6">

    <el-button type="text" @click="dialogVisible = true">点击打开 Dialog</el-button>

    <el-dialog
        title="提示"
        :visible.sync="dialogVisible"
        width="30%"
        :before-close="handleClose">
      <span>这是一段信息</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  </span>
    </el-dialog>
  </el-col>
</div>
</template>
<script>
export default {
  name: "home",
  data() {
    return {
      url: 'https://www.baidu.com/',
      dialogVisible:false
    };
  },
  methods: {
    open() {
      this.$alert('这是一段内容', '标题名称', {
        confirmButtonText: '确定',
        callback: action => {
          this.$message({
            type: 'info',
            message: `action: ${ action }`
          });
        }
      });
    },
    openMsg() {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    openLink(){
      console.log('打开外部链接');
       window.open('https://www.baidu.com/', '_blank');
     // window.location.href='https://www.baidu.com/';
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
    }
  }
}
</script>

<style scoped>

</style>